home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / PInterface Translator / PInterfaces / Serial.p < prev    next >
Encoding:
Text File  |  1993-09-16  |  2.1 KB  |  102 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Sunday, January 6, 1991 at 11:15 PM
  3.     Serial.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.         Copyright Apple Computer, Inc.    1985-1990
  7.         All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT Serial;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingSerial}
  21. {$SETC UsingSerial := 1}
  22.  
  23. {$I+}
  24. {$SETC SerialIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingTypes}
  27. {$I $$Shell(PInterfaces)Types.p}
  28. {$ENDC}
  29. {$SETC UsingIncludes := SerialIncludes}
  30.  
  31. CONST
  32. baud300 = 380;
  33. baud600 = 189;
  34. baud1200 = 94;
  35. baud1800 = 62;
  36. baud2400 = 46;
  37. baud3600 = 30;
  38. baud4800 = 22;
  39. baud7200 = 14;
  40. baud9600 = 10;
  41. baud19200 = 4;
  42. baud57600 = 0;
  43. stop10 = 16384;
  44. stop15 = -32768;
  45. stop20 = -16384;
  46. noParity = 0;
  47. oddParity = 4096;
  48. evenParity = 12288;
  49. data5 = 0;
  50. data6 = 2048;
  51. data7 = 1024;
  52. data8 = 3072;
  53. ctsEvent = 32;
  54. breakEvent = 128;
  55. xOffWasSent = 128;
  56. dtrNegated = 64;
  57. ainRefNum = -6;     {serial port A input}
  58. aoutRefNum = -7;    {serial port A output}
  59. binRefNum = -8;     {serial port B input}
  60. boutRefNum = -9;    {serial port B output}
  61.  
  62. TYPE
  63. SPortSel = (sPortA,sPortB);
  64.  
  65.  
  66. SerShk = PACKED RECORD
  67.     fXOn: Byte;     {XOn flow control enabled flag}
  68.     fCTS: Byte;     {CTS flow control enabled flag}
  69.     xOn: CHAR;      {XOn character}
  70.     xOff: CHAR;     {XOff character}
  71.     errs: Byte;     {errors mask bits}
  72.     evts: Byte;     {event enable mask bits}
  73.     fInX: Byte;     {Input flow control enabled flag}
  74.     fDTR: Byte;     {DTR input flow control flag}
  75.     END;
  76.  
  77. SerStaRec = PACKED RECORD
  78.     cumErrs: Byte;
  79.     xOffSent: Byte;
  80.     rdPend: Byte;
  81.     wrPend: Byte;
  82.     ctsHold: Byte;
  83.     xOffHold: Byte;
  84.     END;
  85.  
  86.  
  87. FUNCTION SerReset(refNum: INTEGER;serConfig: INTEGER): OSErr;
  88. FUNCTION SerSetBuf(refNum: INTEGER;serBPtr: Ptr;serBLen: INTEGER): OSErr;
  89. FUNCTION SerHShake(refNum: INTEGER;flags: SerShk): OSErr;
  90. FUNCTION SerSetBrk(refNum: INTEGER): OSErr;
  91. FUNCTION SerClrBrk(refNum: INTEGER): OSErr;
  92. FUNCTION SerGetBuf(refNum: INTEGER;VAR count: LONGINT): OSErr;
  93. FUNCTION SerStatus(refNum: INTEGER;VAR serSta: SerStaRec): OSErr;
  94.  
  95.  
  96. {$ENDC}    { UsingSerial }
  97.  
  98. {$IFC NOT UsingIncludes}
  99.     END.
  100. {$ENDC}
  101.  
  102.